home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-23 | 2.9 KB | 90 lines | [TEXT/CWIE] |
- //
- // This code provides glue for CFM-based programs to call the
- // the new calls documented in Technote 1043, "Drag Manager Additions".
- // You need only link this module into your program if it is
- // CFM-based (PowerPC or CFM-68K). If you link it in accidentally,
- // it will automatically render itself invisible.
- //
- // Complaints and kudos to:
- //
- // Pete Gontier
- // Apple Macintosh Developer Technical Support
- // <gurgle@apple.com>
- //
- // LEGAL NOTICE
- // ============
- //
- // You may incorporate this sample code into your applications
- // without restriction. This sample code has been provided "AS
- // IS" and the responsibility for its operation is 100% yours.
- // You are not permitted to redistribute the source as "Apple
- // sample code" after having made changes. If you're going to
- // re-distribute the source, we require that you make it clear
- // in the source that the code was descended from Apple sample
- // code, but that you've made changes.
- //
-
- #undef SystemSevenFiveOrLater
- #undef CGLUESUPPORTED
- #undef OLDROUTINENAMES
- #undef OLDROUTINELOCATIONS
- #undef STRICT_WINDOWS
-
- #define SystemSevenFiveOrLater 1
- #define CGLUESUPPORTED 0
- #define OLDROUTINENAMES 0
- #define OLDROUTINELOCATIONS 0
- #define STRICT_WINDOWS 1
-
- #ifndef __CONDITIONALMACROS__
- # include <ConditionalMacros.h>
- #endif
-
- #if GENERATINGCFM
-
- //
- // If we're not generating CFM, then assume the 68K inlines
- // in the headers apply instead.
- //
-
- #include "DragManagerAdditions.h"
-
- pascal OSErr SetDragImage ( DragReference theDragRef,
- PixMapHandle imagePixMap,
- RgnHandle imageRgn,
- Point imageOffsetPt,
- DragImageFlags theImageFlags )
- {
- enum
- {
- uppSetDragImageInfo = kD0DispatchedPascalStackBased
- | RESULT_SIZE (SIZE_CODE (sizeof(OSErr)))
- | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE (SIZE_CODE (sizeof (unsigned long)))
- | DISPATCHED_STACK_ROUTINE_PARAMETER (1, SIZE_CODE (sizeof (theDragRef)))
- | DISPATCHED_STACK_ROUTINE_PARAMETER (2, SIZE_CODE (sizeof (imagePixMap)))
- | DISPATCHED_STACK_ROUTINE_PARAMETER (3, SIZE_CODE (sizeof (imageRgn)))
- | DISPATCHED_STACK_ROUTINE_PARAMETER (4, SIZE_CODE (sizeof (imageOffsetPt)))
- | DISPATCHED_STACK_ROUTINE_PARAMETER (5, SIZE_CODE (sizeof (theImageFlags)))
- };
-
- return CallUniversalProc (GetToolTrapAddress (_DragDispatch), uppSetDragImageInfo, 0x27L,
- theDragRef, imagePixMap, imageRgn, imageOffsetPt, theImageFlags);
- }
-
- pascal OSErr GetDragHiliteColor (WindowPtr window, RGBColor *color)
- {
- enum
- {
- uppGetDragHiliteColorInfo = kD0DispatchedPascalStackBased
- | RESULT_SIZE (SIZE_CODE (sizeof(OSErr)))
- | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE (SIZE_CODE (sizeof (unsigned long)))
- | DISPATCHED_STACK_ROUTINE_PARAMETER (1, SIZE_CODE (sizeof (window)))
- | DISPATCHED_STACK_ROUTINE_PARAMETER (2, SIZE_CODE (sizeof (color)))
- };
-
- return CallUniversalProc (GetToolTrapAddress (_DragDispatch),
- uppGetDragHiliteColorInfo, 0x26L, window, color);
- }
-
- #endif // GENERATINGCFM
-